﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common
{
    /// <summary>
    /// 标准API返回类
    /// </summary>
    public class APIResult
    {
        /// <summary>
        /// 信息提示
        /// </summary>
        public string Message { get; set; }
        /// <summary>
        /// 请求是否成功
        /// </summary>
        public bool Isucess { get; set; }
        /// <summary>
        /// 状态码
        /// </summary>
        public ResultCode Code {  get; set; }

        public APIResult(string person)
        {
            Message = person;
            Isucess = false;
            Code = ResultCode.Fail;
        }
    }

    public class APIResult<T> : APIResult
    {
        /// <summary>
        /// 接受返回数据
        /// </summary>
        public T Data { get; set; }
        public APIResult(string person):base(person)
        {

        }
    }
}
